import BScroll from "better-scroll";//引入betterscroll

let betterScrollHorizontal = function (that, wrapper, content, num, itemWidth) {
    //动态获取到内容区content的宽度
    content.style.width = num * itemWidth + "rem";
    that.$nextTick(() => {
        //wrapper位template中容器的ref，表示给那个元素来设置滚动
        that.scroll = new BScroll(wrapper, {
            scrollY: false,
            scrollX: true,
            startX: 0,
            click: true
        })
    }

    )
}

export { betterScrollHorizontal };